package object;

import java.util.Comparator;
import java.util.PriorityQueue;

class Student1 implements Comparable<Student1>{
    public int ID;
    public String name;
    public int score;

    public Student1(int ID, String name, int score) {
        this.ID = ID;
        this.name = name;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student1{" +
                "ID=" + ID +
                ", name='" + name + '\'' +
                ", score=" + score +
                '}';
    }


    @Override
    public int compareTo(Student1 o) {
        return o.score - this.score;
    }
}

public class Test_5 {
    public static void main(String[] args) {
        PriorityQueue<Student1> pq = new PriorityQueue<>();
        pq.offer(new Student1(1,"zhungsan",60));
        pq.offer(new Student1(2,"zhung",99));
        pq.offer(new Student1(3,"zh",79));
        System.out.println(pq);


    }

}
